﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>考场管理</title>
    <link rel="stylesheet" href="${ctxPath}/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/module/admin.css">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <title>准考证信息</title>
    <style>
        body{
            font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
            font-size: 16px;
            line-height: 1.6;
            padding: 20px;
        }
        h1{
            font-size: 24px;
            margin-bottom: 20px;
        }
        .card{
            width: 800px;
            height: 500px;
            margin: 0 auto;
            padding: 20px;
            box-sizing: border-box;
            border: 2px solid #ccc;
            display: flex;
        }
        .card img{
            width: 200px;
            height: 250px;
            border: 2px solid #ccc;
            background-color: #fff;
            padding: 10px;
            box-sizing: border-box;
            margin-right: 20px;
        }
        table{
            border-collapse: collapse;
            width: 100%;
        }
        td{
            padding: 8px;
            border: 1px solid #ccc;
        }
        .tips {
            margin-top: 20px;
            color: #f00;
        }
    </style>
</head>
<body>
    <div class="card">
        <img id="img" src="https://via.placeholder.com/200x250.png?text=Photo" alt="考生照片">
        <div>
            <h1>准考证信息</h1>
            <table>
                <tr>
                    <td>姓名：</td>
                    <td id="name"></td>
                    <td>性别：</td>
                    <td id="sex"></td>
                </tr>
                <tr>
                    <td>出生日期：</td>
                    <td id="borndate"></td>
                    <td>准考证号：</td>
                    <td id="id"></td>
                </tr>
                <tr>
                    <td>考试时间：</td>
                    <td colspan="3">2023年4月1日 9:00-11:00</td>
                </tr>
                <tr>
                    <td>考试地点：</td>
                    <td colspan="3">XX中学</td>
                </tr>
            </table>
            <div class="tips">温馨提示：请于考试前15分钟到达考场，携带好相关考试材料。</div>
        </div>
    </div>
</body>
<!-- js部分 -->
<script src="${ctxPath}/assets/libs/layui/layui.js"></script>
<script src="${ctxPath}/assets/js/common.js"></script>
<script>
    layui.use(['layer', 'table', 'tableX', 'notice', 'xnUtil', 'laydate'], function () {
        var $ = layui.jquery;
        var admin = layui.admin;

        var account = layui.data(admin.setter.tableName).loginUser.account;

        admin.req(getProjectUrl() + 'baokao/list?auditStatus=1&idcard='+account, function(res){
            console.log(res.data[0].name);
            $("#name").text(res.data[0].name);
            $("#sex").text(res.data[0].sex);
            var borndate = res.data[0].borndate;
            var substr = borndate.substring(0, 10);
            $("#borndate").text(substr);
            $("#id").text(res.data[0].id);
            var img = res.data[0].img;
            let newStr = img.substring(0, img.length - 4)
            $("#img").attr("src","${ctxPath}/sysFileInfo/preview?id="+newStr);
        }, 'get');


    });
</script>
</html>
